
String.prototype.call = function(){
    if(!Array.prototype.clean) {
        
        String.prototype.trim = function() {
           return this.replace(/^\s+|\s+$/g,'');
        }

        Array.prototype.clean = function(){
		    var results = [];
		    for(var i=0; i<=this.length; i++) {
		        if(!this[i]) delete this[i];
		        else results.push(this[i])
		    }
		    return results;
		};
    }
    var args = Array.prototype.slice.call(arguments,1,arguments.length);
    var parts  = this.split("->");
    var params = parts[0] ? parts[0].trim().split(" "):parts[0];
    
    var body   = parts[1];
    params = (params instanceof Array)? params.clean():params;

    body = (/\^/.test(body)) ? body.replace("^","return"):("return " + body);

    var f = new Function(params, body);
   
     //console.log(f.toString())
    if(args.length > 0) {
        return f.apply(args[0],args)} 
    else {return function(){ return f.apply(args[0],arguments)}}
};

//var person = {name:"jason"};
//
//var res = 'p v -> p'.call();
//res.call(person,2)

//console.log((function(n){return "hi " + n})("f"));
//Array.prototype.slice.call(arguments,1,arguments.length)
